const {merge} =require('webpack-merge')

const commomConfig=require('./webpack.common.config')
const productionConfig=require('./webpack.prod.config')
const developmentConfig=require('./webpack.dev.config')

module.exports=(env,args)=>{
    // console.log(env);
    // console.log(args);
    switch(env){
        case 'development':
            return merge(commomConfig,developmentConfig);
        case 'production':
            return merge(commomConfig,productionConfig);
        default:
            throw new Error('No matching configuration was found!')
    }
}